import subprocess
def checkIP(ip):
    ping_cmd = "ping -n 1 -w 1 %s" % ip
    null = open("win_null",mode="wb")
    ping_result = subprocess.call(ping_cmd,shell=True,stdout=null,stderr=null)
    if ping_result == 0:
        print("Host [%s] is up !!" %ip)

if  __name__ == "__main__":
    for i in range(1,255):
        ip = "10.11.2.%d" %i
        checkIP(ip=ip)
    checkIP("10.11.2.1")